import request from '@/utils/request';
import qs from 'qs';
export function add(data) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + '/patient/create',
    method: 'post',
    data
  });
}
export function star(data) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + '/patient/star',
    method: 'put',
    data
  });
}
export function archive(data) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + 'patient/archive',
    method: 'put',
    data
  });
}

export function del(ids) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + '/patient/delete',
    method: 'delete',
    data: ids
  });
}
// 导出数据
export function download(params) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + '/patient/download' + '?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  });
}

export function edit(data) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + '/patient/update',
    method: 'put',
    data
  });
}
// 获取病例页面显示数据。
export function getPageConf(params) {
  return request({
    url: process.env.VUE_APP_LOG_API + '/base/formConfig/query',
    method: 'get',
    params
  });
}
// 获取病例页面显示数据。
export function getPatientLine(params) {
  return request({
    url: process.env.VUE_APP_PRIVATE_API + '/patient/patientEvent/query',
    method: 'get',
    params
  });
}

export default { add, edit, del, star, archive, getPatientLine };
